﻿using System;

namespace Heimdallr
{
    /// <summary>
    /// Provides data for <see cref="ITriggerElement.Notify"/> event.
    /// </summary>
    public class FireNotificationEventArgs : EventArgs
    {
        #region Field

        private readonly Notification notification;

        #endregion

        #region Property

        /// <summary>
        /// Gets the latest notification.
        /// </summary>
        public Notification Notification
        {
            get { return this.notification; }
        }

        #endregion

        #region Constructor

        /// <summary>
        /// Initializes a new instance of this class, using specified notification. 
        /// </summary>
        /// <param name="notification">The notification which be fired.</param>
        /// <exception cref="ArgumentNullException">Parameter <paramref name="notification"/> is null.</exception>
        public FireNotificationEventArgs(Notification notification)
        {
            if (notification == null)
                throw new ArgumentNullException("notification");

            this.notification = notification;
        }

        #endregion
    }

    /// <summary>
    /// Represents the method that will handle the <see cref="ITriggerElement.Notify"/> event.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">A <see cref="FireNotificationEventArgs"/> that contains the event data.</param>
    public delegate void FireNotificationEventHandler(object sender, FireNotificationEventArgs e);
}